--[[
	TestAPI
		by eXtragoZ
		
	The script prints the result of each function and constant on the API
	some are commented as ERROR because do not work
	shift + left click to move the text up and down
	spacebar to check buffs
]]
local xtext = 10
local xtext2 = 800
local ytext = 10
local stext = 15
local color = RGBA(0,255,0,255)
function OnLoad()
	PrintChat("PrintChat TestAPI")
	--SendChat("SendChat")
	--PingSignal(PING_NORMAL,myHero.x,myHero.y,myHero.z,2)
	PrintFloatText(myHero,0,"PrintFloatText")
end
function OnDraw()
	if IsKeyDown(16) and IsKeyDown(1) then ytext = 80 - GetCursorPos().y end
	DrawLine(250, 50, 400, 100, 2, color)
	DrawText("GetTickCount(): "..GetTickCount(), stext, xtext, ytext+stext*0, color)
	DrawText("GetGameTimer(): "..GetGameTimer(), stext, xtext, ytext+stext*1, color)
	DrawText("GetInGameTimer(): "..GetInGameTimer(), stext, xtext, ytext+stext*2, color)
	DrawText("GetLatency(): "..GetLatency(), stext, xtext, ytext+stext*3, color)
	DrawText("GetCursorPos().x: "..GetCursorPos().x, stext, xtext, ytext+stext*4, color)
	DrawText("GetCursorPos().y: "..GetCursorPos().y, stext, xtext, ytext+stext*5, color)
	DrawText("mousePos.x: "..mousePos.x, stext, xtext, ytext+stext*6, color)
	DrawText("mousePos.y: "..mousePos.y, stext, xtext, ytext+stext*7, color)
	DrawText("mousePos.z: "..mousePos.z, stext, xtext, ytext+stext*8, color)
	DrawText("cameraPos.x: "..cameraPos.x, stext, xtext, ytext+stext*9, color)
	DrawText("cameraPos.y: "..cameraPos.y, stext, xtext, ytext+stext*10, color)
	DrawText("cameraPos.z: "..cameraPos.z, stext, xtext, ytext+stext*11, color)
	--DrawText("IsWallOfGrass(myHero.pos): "..(IsWallOfGrass(myHero.pos) and "true" or "false"), stext, xtext, ytext+stext*12, color)
	DrawText("IsWallOfGrass(myHero.pos): ERROR", stext, xtext, ytext+stext*12, color)
	DrawText("GetKey(A): "..GetKey(A), stext, xtext, ytext+stext*13, color)
	DrawText("RGBA(255,0,0,255): "..RGBA(255,0,0,255), stext, xtext, ytext+stext*14, color)
	DrawText("RGB(255,0,0): "..RGB(255,0,0), stext, xtext, ytext+stext*15, color)
	DrawText("objManager.maxObjects: "..objManager.maxObjects, stext, xtext, ytext+stext*16, color)
	DrawText("objManager.iCount: "..objManager.iCount, stext, xtext, ytext+stext*17, color)
	DrawText("heroManager.iCount: "..heroManager.iCount, stext, xtext, ytext+stext*18, color)
	DrawText("myHero.name: "..myHero.name, stext, xtext, ytext+stext*19, color)
	DrawText("myHero.charName: "..myHero.charName, stext, xtext, ytext+stext*20, color)
	DrawText("myHero.level: "..myHero.level, stext, xtext, ytext+stext*21, color)
	DrawText("myHero.visible: "..(myHero.visible and "true" or "false"), stext, xtext, ytext+stext*22, color)
	DrawText("myHero.type: "..myHero.type, stext, xtext, ytext+stext*23, color)
	DrawText("myHero.x: "..myHero.x, stext, xtext, ytext+stext*24, color)
	DrawText("myHero.y: "..myHero.y, stext, xtext, ytext+stext*25, color)
	DrawText("myHero.z: "..myHero.z, stext, xtext, ytext+stext*26, color)
	DrawText("myHero.isAI: "..(myHero.isAI and "true" or "false"), stext, xtext, ytext+stext*27, color)
	DrawText("myHero.isMe: "..(myHero.isMe and "true" or "false"), stext, xtext, ytext+stext*28, color)
	DrawText("myHero.buffCount: "..myHero.buffCount, stext, xtext, ytext+stext*29, color)
	DrawText("myHero.totalDamage: "..myHero.totalDamage, stext, xtext, ytext+stext*30, color)
	DrawText("myHero.dead: "..(myHero.dead and "true" or "false"), stext, xtext, ytext+stext*31, color)
	DrawText("myHero.networkID: "..myHero.networkID, stext, xtext, ytext+stext*32, color)	
	DrawText("myHero.health: "..myHero.health, stext, xtext, ytext+stext*33, color)
	DrawText("myHero.maxHealth: "..myHero.maxHealth, stext, xtext, ytext+stext*34, color)
	DrawText("myHero.mana: "..myHero.mana, stext, xtext, ytext+stext*35, color)
	DrawText("myHero.maxMana: "..myHero.maxMana, stext, xtext, ytext+stext*36, color)
	DrawText("myHero.bInvulnerable: "..(myHero.bInvulnerable and "true" or "false"), stext, xtext, ytext+stext*37, color)
	DrawText("myHero.bPhysImune: "..(myHero.bPhysImune and "true" or "false"), stext, xtext, ytext+stext*38, color)
	DrawText("myHero.bTargetable: "..(myHero.bTargetable and "true" or "false"), stext, xtext, ytext+stext*39, color)
	DrawText("myHero.bTargetableToTeam: "..(myHero.bTargetableToTeam and "true" or "false"), stext, xtext, ytext+stext*40, color)
	DrawText("myHero.controlled: "..(myHero.controlled and "true" or "false"), stext, xtext, ytext+stext*41, color)
	DrawText("myHero.cdr: "..myHero.cdr, stext, xtext, ytext+stext*42, color)
	DrawText("myHero.critChance: "..myHero.critChance, stext, xtext, ytext+stext*43, color)
	DrawText("myHero.critDmg: "..myHero.critDmg, stext, xtext, ytext+stext*44, color)
	DrawText("myHero.hpPool: "..myHero.hpPool, stext, xtext, ytext+stext*45, color)
	DrawText("myHero.hpRegen: "..myHero.hpRegen, stext, xtext, ytext+stext*46, color)
	DrawText("myHero.mpRegen: "..myHero.mpRegen, stext, xtext, ytext+stext*47, color)
	DrawText("myHero.attackSpeed: "..myHero.attackSpeed, stext, xtext, ytext+stext*48, color)
	DrawText("myHero.expBonus: "..myHero.expBonus, stext, xtext, ytext+stext*49, color)
	DrawText("myHero.hardness: "..myHero.hardness, stext, xtext, ytext+stext*50, color)
	DrawText("myHero.lifeSteal: "..myHero.lifeSteal, stext, xtext, ytext+stext*51, color)
	DrawText("myHero.spellVamp: "..myHero.spellVamp, stext, xtext, ytext+stext*52, color)
	DrawText("myHero.physReduction: "..myHero.physReduction, stext, xtext, ytext+stext*53, color)
	DrawText("myHero.magicReduction: "..myHero.magicReduction, stext, xtext, ytext+stext*54, color)
	DrawText("myHero.armorPen: "..myHero.armorPen, stext, xtext, ytext+stext*55, color)
	DrawText("myHero.magicPen: "..myHero.magicPen, stext, xtext, ytext+stext*56, color)
	DrawText("myHero.armorPenPercent: "..myHero.armorPenPercent, stext, xtext, ytext+stext*57, color)
	--DrawText("myHero.magicPenPerecent: "..myHero.magicPenPerecent, stext, xtext, ytext+stext*58, color)
	DrawText("myHero.magicPenPerecent: ERROR", stext, xtext, ytext+stext*58, color)
	DrawText("myHero.addDamage: "..myHero.addDamage, stext, xtext, ytext+stext*59, color)
	DrawText("myHero.ap: "..myHero.ap, stext, xtext, ytext+stext*60, color)
	DrawText("myHero.damage: "..myHero.damage, stext, xtext, ytext+stext*61, color)
	DrawText("myHero.armor: "..myHero.armor, stext, xtext, ytext+stext*62, color)
	DrawText("myHero.magicArmor: "..myHero.magicArmor, stext, xtext, ytext+stext*63, color)
	DrawText("myHero.ms: "..myHero.ms, stext, xtext, ytext+stext*64, color)
	DrawText("myHero.range: "..myHero.range, stext, xtext, ytext+stext*65, color)
	DrawText("myHero.gold: "..myHero.gold, stext, xtext, ytext+stext*66, color)
	--DrawText("myHero.minBBox: "..myHero.minBBox, stext, xtext, ytext+stext*67, color)
	DrawText("myHero.minBBox: ERROR", stext, xtext, ytext+stext*67, color)
	--DrawText("myHero.maxBBox: "..myHero.maxBBox, stext, xtext, ytext+stext*68, color)
	DrawText("myHero.maxBBox: ERROR", stext, xtext, ytext+stext*68, color)
	DrawText("myHero.armorMaterial: "..myHero.armorMaterial, stext, xtext, ytext+stext*69, color)
	DrawText("myHero.weaponMaterial: "..myHero.weaponMaterial, stext, xtext, ytext+stext*70, color)
	DrawText("myHero.deathTimer: "..myHero.deathTimer, stext, xtext, ytext+stext*71, color)
	DrawText("myHero.canAttack: "..(myHero.canAttack and "true" or "false"), stext, xtext, ytext+stext*72, color)
	DrawText("myHero.canMove: "..(myHero.canMove and "true" or "false"), stext, xtext, ytext+stext*73, color)
	DrawText("myHero.isStealthed: "..(myHero.isStealthed and "true" or "false"), stext, xtext, ytext+stext*74, color)
	DrawText("myHero.isRevealSpecificUnit: "..(myHero.isRevealSpecificUnit and "true" or "false"), stext, xtext, ytext+stext*75, color)
	DrawText("myHero.isTaunted: "..(myHero.isTaunted and "true" or "false"), stext, xtext, ytext+stext*76, color)
	DrawText("myHero.isCharmed: "..(myHero.isCharmed and "true" or "false"), stext, xtext, ytext+stext*77, color)
	DrawText("myHero.isFeared: "..(myHero.isFeared and "true" or "false"), stext, xtext, ytext+stext*78, color)
	DrawText("myHero.isAsleep: "..(myHero.isAsleep and "true" or "false"), stext, xtext, ytext+stext*79, color)
	DrawText("myHero.isNearSight: "..(myHero.isNearSight and "true" or "false"), stext, xtext, ytext+stext*80, color)
	DrawText("myHero.isGhosted: "..(myHero.isGhosted and "true" or "false"), stext, xtext, ytext+stext*81, color)
	DrawText("myHero.isNoRender: "..(myHero.isNoRender and "true" or "false"), stext, xtext, ytext+stext*82, color)
	DrawText("myHero.isFleeing: "..(myHero.isFleeing and "true" or "false"), stext, xtext, ytext+stext*83, color)
	DrawText("myHero.isForceRenderParticles: "..(myHero.isForceRenderParticles and "true" or "false"), stext, xtext, ytext+stext*84, color)
	--DrawText("myHero.minionScore: "..myHero.minionScore, stext, xtext, ytext+stext*85, color)
	DrawText("myHero.minionScore: ERROR", stext, xtext, ytext+stext*85, color)
	DrawText("myHero.casting: "..myHero.casting, stext, xtext, ytext+stext*86, color)
	
	DrawText("CanUseSpell(_Q): "..myHero:CanUseSpell(_Q), stext, xtext2, ytext+stext*0, color)
	DrawText("         GetSpellData(_Q)", stext, xtext2, ytext+stext*1, color)
	DrawText(".name: "..myHero:GetSpellData(_Q).name, stext, xtext2, ytext+stext*2, color)
	DrawText(".level: "..myHero:GetSpellData(_Q).level, stext, xtext2, ytext+stext*3, color)
	DrawText(".mana: "..myHero:GetSpellData(_Q).mana, stext, xtext2, ytext+stext*4, color)
	DrawText(".cd: "..myHero:GetSpellData(_Q).cd, stext, xtext2, ytext+stext*5, color)
	DrawText(".currentCd: "..myHero:GetSpellData(_Q).currentCd, stext, xtext2, ytext+stext*6, color)
	DrawText(".range: "..myHero:GetSpellData(_Q).range, stext, xtext2, ytext+stext*7, color)
	DrawText(".channelDuration: "..myHero:GetSpellData(_Q).channelDuration, stext, xtext2, ytext+stext*8, color)
	DrawText("        myHero:getItem(ITEM_1)", stext, xtext2, ytext+stext*9, color)
	DrawText(".name: "..(myHero:getItem(ITEM_1) and myHero:getItem(ITEM_1).name or "noitem"), stext, xtext2, ytext+stext*10, color)
	DrawText(".id: "..(myHero:getItem(ITEM_1) and myHero:getItem(ITEM_1).id or "noitem"), stext, xtext2, ytext+stext*11, color)
	DrawText(".stacks: "..(myHero:getItem(ITEM_1) and myHero:getItem(ITEM_1).stacks or "noitem"), stext, xtext2, ytext+stext*12, color)
	DrawText("myHero:getInventorySlot(ITEM_1): "..myHero:getInventorySlot(ITEM_1), stext, xtext2, ytext+stext*13, color)
	DrawText("        Constants:", stext, xtext2, ytext+stext*14, color)
	DrawText("READY: "..READY, stext, xtext2, ytext+stext*15, color)
	DrawText("NOTLEARNED: "..NOTLEARNED, stext, xtext2, ytext+stext*16, color)
	DrawText("SUPRESSED: "..SUPRESSED, stext, xtext2, ytext+stext*17, color)
	DrawText("COOLDOWN: "..COOLDOWN, stext, xtext2, ytext+stext*18, color)
	DrawText("NOMANA: "..NOMANA, stext, xtext2, ytext+stext*19, color)
	DrawText("UNKNOWN: "..UNKNOWN, stext, xtext2, ytext+stext*20, color)
	DrawText("KEY_DOWN: "..KEY_DOWN, stext, xtext2, ytext+stext*21, color)
	DrawText("KEY_UP: "..KEY_UP, stext, xtext2, ytext+stext*22, color)
	DrawText("WM_MOUSEMOVE: "..WM_MOUSEMOVE, stext, xtext2, ytext+stext*23, color)
	DrawText("WM_LBUTTONDOWN: "..WM_LBUTTONDOWN, stext, xtext2, ytext+stext*24, color)
	DrawText("WM_LBUTTONUP: "..WM_LBUTTONUP, stext, xtext2, ytext+stext*25, color)
	DrawText("WM_RBUTTONDOWN: "..WM_RBUTTONDOWN, stext, xtext2, ytext+stext*26, color)
	DrawText("WM_RBUTTONUP: "..WM_RBUTTONUP, stext, xtext2, ytext+stext*27, color)
	DrawText("PING_NORMAL: "..PING_NORMAL, stext, xtext2, ytext+stext*28, color)
	DrawText("PING_FALLBACK: "..PING_FALLBACK, stext, xtext2, ytext+stext*29, color)
	DrawText("TEAM_NONE: "..TEAM_NONE, stext, xtext2, ytext+stext*30, color)
	DrawText("TEAM_BLUE: "..TEAM_BLUE, stext, xtext2, ytext+stext*31, color)
	DrawText("TEAM_RED: "..TEAM_RED, stext, xtext2, ytext+stext*32, color)
	DrawText("TEAM_NEUTRAL: "..TEAM_NEUTRAL, stext, xtext2, ytext+stext*33, color)
	DrawText("TEAM_ENEMY: "..TEAM_ENEMY, stext, xtext2, ytext+stext*34, color)
	UpdateWindow()
	DrawText("WINDOW_X: "..WINDOW_X, stext, xtext2, ytext+stext*35, color)
	DrawText("WINDOW_Y: "..WINDOW_Y, stext, xtext2, ytext+stext*36, color)
	DrawText("WINDOW_W: "..WINDOW_W, stext, xtext2, ytext+stext*37, color)
	DrawText("WINDOW_H: "..WINDOW_H, stext, xtext2, ytext+stext*38, color)
	DrawText("_Q: ".._Q, stext, xtext2, ytext+stext*39, color)
	DrawText("_W: ".._W, stext, xtext2, ytext+stext*40, color)
	DrawText("_E: ".._E, stext, xtext2, ytext+stext*41, color)
	DrawText("_R: ".._R, stext, xtext2, ytext+stext*42, color)
	DrawText("SPELL_1: "..SPELL_1, stext, xtext2, ytext+stext*43, color)
	DrawText("SPELL_2: "..SPELL_2, stext, xtext2, ytext+stext*44, color)
	DrawText("SPELL_3: "..SPELL_3, stext, xtext2, ytext+stext*45, color)
	DrawText("SPELL_4: "..SPELL_4, stext, xtext2, ytext+stext*46, color)
	DrawText("ITEM_1: "..ITEM_1, stext, xtext2, ytext+stext*47, color)
	DrawText("ITEM_2: "..ITEM_2, stext, xtext2, ytext+stext*48, color)
	DrawText("ITEM_3: "..ITEM_3, stext, xtext2, ytext+stext*49, color)
	DrawText("ITEM_4: "..ITEM_4, stext, xtext2, ytext+stext*50, color)
	DrawText("ITEM_5: "..ITEM_5, stext, xtext2, ytext+stext*51, color)
	DrawText("ITEM_6: "..ITEM_6, stext, xtext2, ytext+stext*52, color)
	DrawText("RECALL: "..RECALL, stext, xtext2, ytext+stext*53, color)
	DrawText("SUMMONER_1: "..SUMMONER_1, stext, xtext2, ytext+stext*54, color)
	DrawText("SUMMONER_2: "..SUMMONER_2, stext, xtext2, ytext+stext*55, color)

end
function BuffCheck()
	PrintChat("--------------------------------")
	for i = 1, myHero.buffCount do
		local buff = myHero:getBuff(i)
		if buff.name ~= nil then
			if buff.valid then bvalid = "true" else bvalid = "false" end
			PrintChat("N: "..buff.name.." S: "..buff.startT.." E: "..buff.endT.." V: "..bvalid.." I: "..i)
		end
	end
end
function OnWndMsg(msg, key)
	if key == 32 and msg == KEY_DOWN then
		BuffCheck()
	end
end
